<template>
  <view>
    <view class="contentWrapper">
      <uv-form labelPosition="left" :model="formData" :labelWidth="100" :rules="rules" ref="form">
        <view class="infoCard">
          <view class="titleInfo">
            <view class="titleText">个人身份信息</view>
          </view>
          <uv-form-item label="真实姓名" required prop="realName" borderBottom>
            <template v-slot:right>
              <uv-input inputAlign="right" placeholder="真实姓名" v-model="formData.realName" border="none">
              </uv-input>
            </template>
          </uv-form-item>

          <uv-form-item label="身份证" required prop="cardNo" borderBottom>
            <template v-slot:right>
              <uv-input inputAlign="right" placeholder="身份证号" v-model="formData.cardNo" border="none">
              </uv-input>
            </template>
          </uv-form-item>

          <!--          <uv-form-item label="身份证正面" required prop="cardFrontImg" borderBottom>-->
          <!--            <template v-slot:right>-->
          <!--              <UvUpload :dataList="formData.cardFrontImg?[formData.cardFrontImg]:[]" :params="{name:'cardFrontImg'}" :upload_max="1"-->
          <!--                        @uploadChange="uploadSuccess"/>-->
          <!--            </template>-->
          <!--          </uv-form-item>-->

          <!--          <uv-form-item label="身份证返面" required prop="cardBackImg" borderBottom>-->
          <!--            <template v-slot:right>-->
          <!--              <UvUpload :dataList="(formData.cardBackImg!==undefined && formData.cardBackImg!==null)?[formData.cardBackImg]:[]"-->
          <!--                        :params="{name:'cardBackImg'}" :upload_max="1" @uploadChange="uploadSuccess"/>-->
          <!--            </template>-->
          <!--          </uv-form-item>-->


          <!--          <uv-form-item label="有效起始日" required prop="certStartDate" borderBottom>-->
          <!--            <template v-slot:right>-->
          <!--              <uv-input inputAlign="right" v-show="false" placeholder="身份证号" v-model="calendarFieldValue" border="none">-->
          <!--              </uv-input>-->
          <!--              <view style="width: 100%" @click="openDate('certStartDate')">-->
          <!--                <uv-text v-if="formData.certStartDate !==undefined && formData.certStartDate!==null && formData.certStartDate!==''"-->
          <!--                         :text="formData.certStartDate"/>-->
          <!--                <uv-text v-else color="rgb(192, 196, 204)" text="输入身份证有效起始日"/>-->
          <!--              </view>-->
          <!--            </template>-->
          <!--          </uv-form-item>-->

          <!--          <uv-form-item label="到期日" prop="certEndDate" borderBottom>-->
          <!--            <template v-slot:right>-->
          <!--              <uv-input inputAlign="right" v-show="false" placeholder="" v-model="calendarFieldValue" border="none">-->
          <!--              </uv-input>-->
          <!--              <view style="" @click="openDate('certEndDate')">-->
          <!--                <uv-text v-if="formData.certEndDate" :text="formData.certEndDate"/>-->
          <!--                <uv-text v-else color="rgb(192, 196, 204)" text="身份证到期日，永久不填"/>-->
          <!--              </view>-->
          <!--            </template>-->
          <!--          </uv-form-item>-->
        </view>

        <view class="infoCard">
          <view class="titleInfo">
            <view class="titleText">收款信息</view>
          </view>

          <uv-form-item label="持卡类型" required prop="settlementAccountType" borderBottom>
            <template v-slot:right>
              <uv-radio-group v-model="settlementAccountType">
                <uv-radio :disabled="false" :activeColor="themConfig.theme.color" name="01" value="01" label="对私"></uv-radio>
              </uv-radio-group>
            </template>
          </uv-form-item>
          <uv-form-item label="所属银行" required prop="bankName" borderBottom>
            <template v-slot:right>
              <uv-input inputAlign="right" placeholder="所属银行" v-model="formData.bankName" border="none">
              </uv-input>
            </template>
          </uv-form-item>

          <!--          <uv-form-item label="所属支行" required prop="branchName" borderBottom>-->
          <!--            <template v-slot:right>-->
          <!--              <uv-input inputAlign="right" placeholder="所属支行" v-model="formData.branchName" border="none">-->
          <!--              </uv-input>-->
          <!--            </template>-->
          <!--          </uv-form-item>-->

          <uv-form-item label="银行卡号" required prop="bankCardNo" borderBottom>
            <template v-slot:right>
              <uv-input inputAlign="right" placeholder="银行卡号" v-model="formData.bankCardNo" border="none">
              </uv-input>
            </template>
          </uv-form-item>

          <uv-form-item label="预留手机" required prop="bankCardPhone" borderBottom>
            <template v-slot:right>
              <uv-input inputAlign="right" placeholder="银行卡预留手机" v-model="formData.bankCardPhone" border="none">
              </uv-input>
            </template>
          </uv-form-item>

        </view>


        <view class="infoCard">
          <view class="titleInfo">
            <view class="titleText">微信支付宝</view>
          </view>
          <uv-form-item label="微信收款码" prop="wechatPaymentCode" borderBottom>
            <template v-slot:right>
              <UvUpload :dataList="formData.wechatPaymentCode?[formData.wechatPaymentCode]:[]" :params="{name:'wechatPaymentCode'}"
                        :upload_max="1" @uploadChange="uploadSuccess"/>
            </template>
          </uv-form-item>

          <uv-form-item label="支付宝收款码" prop="alipayPaymentCode" borderBottom>
            <template v-slot:right>
              <UvUpload :dataList="formData.alipayPaymentCode?[formData.alipayPaymentCode]:[]" :params="{name:'alipayPaymentCode'}"
                        :upload_max="1" @uploadChange="uploadSuccess"/>
            </template>
          </uv-form-item>
        </view>

        <view class="infoCard">
          <uv-form-item label="状态" prop="state" borderBottom>
            <template v-slot:right>
              <!--   学生认证状态:0=待审核，1=审核通过，2=审核不通过-->
              <text style="color:#f9ae3d" v-if="formData.state === 0">
                审核中
              </text>
              <text style="color:#5ac725" v-else-if="formData.state === 1">
                审核通过
              </text>

              <text style="color:#f56c6c" v-if="formData.state===-1">
                {{ '审核不通过：' + formData.failReason }}
              </text>
            </template>
          </uv-form-item>
        </view>

        <view style="width: 100%;margin-top: 20px">
          <uv-button :disabled="(formData.state === 1 || formData.state === 0)" @click="submit" text="提交"
                     :color="'linear-gradient(to right,' + themConfig.theme.subColor + ',' + themConfig.theme.color + ')'"></uv-button>
        </view>
      </uv-form>
    </view>
    <uv-datetime-picker
        ref="datetimePicker"
        v-model="calendarFieldValue"
        mode="date"
        :minDate="345819624000"
        :maxDate="4101112584000"
        :formatter="formatter"
        @confirm="confirmDate"
    >
    </uv-datetime-picker>
  </view>
</template>
<script>

import {mixins} from './index.js'

export default {
  mixins: [mixins],
}
</script>

<style scoped lang="scss">
@import './index.scss';
</style>
